//
//  TKIMUserDBProtocol.h
//  TKIM_标准版
//
//  Created by liupm on 16/3/14.
//  Copyright © 2016年 liupm. All rights reserved.
//

@protocol TKIMUserDBProtocol <NSObject>

@optional

/**
 *  @Author lpm, 15-10-29 14:10:24
 *
 *  @brief  缓存一个用户对象
 */
-(void)insertUser:(TKIMUser *)user;


/**
 *  @Author lpm, 16-12-31 13:12:37
 *
 *  @brief  缓存一个用户对象
 *
 *  @param user     用户
 *  @param callBack 回调
 */
-(void)insertUser:(TKIMUser *)user callBack:(void(^)())callBack;


/**
 *  @Author lpm, 15-10-29 14:10:24
 *
 *  @brief  缓存多个用户对象
 */
-(void)insertUsers:(NSMutableArray *)users;


/**
 *  @Author lpm, 15-10-29 15:10:45
 *
 *  @brief  删除一个用户
 *
 *  @param obj
 */
-(void)removeUser:(TKIMUser *)user;


/**
 *  @Author lpm, 15-10-29 15:10:45
 *
 *  @brief  删除多个用户
 *
 *  @param obj
 */
-(void)removeUsers:(NSMutableArray *)users;


/**
 *  @Author lpm, 15-10-29 15:10:46
 *
 *  @brief  更新一条用户数据
 *
 *  @param object
 */
-(void)updateUser:(TKIMUser *)user;


/**
 *  @Author lpm, 15-10-29 15:10:46
 *
 *  @brief  更新多条用户数据
 *
 *  @param object
 */
-(void)updateUsers:(NSMutableArray *)users;


/**
 *  @Author lpm, 16-01-14 13:01:38
 *
 *  @brief  修改用户好友的分组
 *
 *  @param user 用户对象
 *  @param group  组
 */
-(void)modifyUserPacket:(TKIMUser *)user  groupId:(NSString *)groupId;


/**
 *  @Author lpm, 15-10-29 15:10:25
 *
 *  @brief  查询某种类型的所有用户
 *
 *  @param key
 *
 *  @return
 */
-(NSMutableArray *)queryUsersByUserType:(NSInteger)userType;


/**
 *  @Author lpm, 16-03-23 14:03:58
 *
 *  @brief  查询某种类型关注和未关注的所有用户
 *
 *  @param userType    用户类型
 *  @param isAttention
 *
 *  @return
 */
-(NSMutableArray *)queryUsersByUserType:(NSInteger)userType  isAttention:(BOOL) isAttention;


/**
 *  @Author lpm, 15-12-15 10:12:09
 *
 *  @brief  从本地查询某个用户
 *
 *  @param userId 用户Id
 *
 *  @return
 */
-(TKIMUser *)queryAHisUserByUserId:(NSString *)userId;


/**
 *  @Author lpm, 15-10-29 15:10:25
 *
 *  @brief  查询一个用户结果集
 *
 *  @param key
 *
 *  @return
 */
-(NSMutableArray *)queryUsersBy:(NSString *)key;


/**
 *  @Author lpm, 15-10-29 15:10:25
 *
 *  @brief  模糊查询一个结果集
 *
 *  @param key
 *
 *  @return
 */
-(NSMutableArray *)queryUserByKey:(NSString *)key userType:(NSInteger)userType;


/**
 *  @Author lpm, 15-10-29 15:10:46
 *
 *  @brief  更新用户置顶状态
 *
 *  @param object
 */
-(void)setUserIsToTop:(TKIMUser *)user;


/**
 *  @Author lpm, 15-10-29 15:10:46
 *
 *  @brief  更新用户消息接收状态
 *
 *  @param object
 */
-(void)updateUserIsAcceptPush:(TKIMUser *)user;


/**
 *  @Author lpm, 15-10-29 15:10:46
 *
 *  @brief  更新用户消息屏蔽状态
 *
 *  @param object
 */
-(void)updateUserIsShield:(TKIMUser *)user;


/**
 *  @Author lpm, 15-10-29 15:10:46
 *
 *  @brief  更新用户被关注状态
 *
 *  @param object
 */
-(void)updateUserIsAttention:(TKIMUser *)user;


/**
 *  @Author lpm, 16-03-03 16:03:49
 *
 *  @brief  更新用户在线状态
 *
 *  @param user
 */
-(void)updateUserOnlineState:(TKIMUser *)user;


/**
 *  @Author lpm, 16-03-03 16:03:49
 *
 *  @brief  更新用户扩展信息
 *
 *  @param user
 */
-(void)updateUserExt:(TKIMUser *)user;


/**
 *  @Author lpm, 16-03-03 16:03:13
 *
 *  @brief  查询某个组里用户的某种在线状态数
 *
 *  @param onlineState
 *  @param groupId
 *
 *  @return
 */
-(NSInteger)queryUserOnlineStateCount:(NSString *)onlineState inGroup:(NSString *)groupId;


/**
 *  @Author lpm, 16-02-02 11:02:03
 *
 *  @brief  更新用户分组信息
 *
 *  @param group
 */
-(void)updateUserGroupInfo:(TKIMUserGroup *)group;


/**
 *  @Author lpm, 16-01-14 13:01:38
 *
 *  @brief  修改用户好友的分组
 *
 *  @param user 用户对象
 *  @param group  组
 */
-(void)modifyUserPacket:(TKIMUser *)user toGroup:(TKIMUserGroup *)group;


/**
 *  @Author lpm, 15-12-15 18:12:55
 *
 *  @brief  清空某种类型的用户
 *
 *  @param userType
 */
-(void)cleanUser:(NSInteger)userType;


/**
 *  @Author lpm, 16-01-15 18:01:02
 *
 *  @brief  按好友类型查询分组后的用户
 *
 *  @param userType 用户类型
 *
 *  @return
 */
-(NSMutableArray *)queryUserByGroupId:(NSString *)groupId  userType:(NSInteger)userType;


/**
 *  @Author lpm, 16-03-10 17:03:02
 *
 *  @brief  查询某种用户类型的黑名单
 *
 *  @param userType
 *
 *  @return
 */
-(NSMutableArray *)queryUserBlackList:(NSInteger)userType;


/**
 *  @Author lpm, 16-03-14 14:03:59
 *
 *  @brief  修改用户备注
 *
 *  @param remark
 *  @param userId
 */
-(void)updateUserRemark:(TKIMUser *)user;


@end